package com.architecture.entity;

import java.io.Serializable;

import com.architecture.util.object.ObjectUtility;

/**
 * <p>Base class of all entities.</p>
 * @author JR
 * @version 1.0
 * @category Entities
 */
public abstract class Entity implements Cloneable{

	/**
	 * <p>Returns the identifier of the entity</p>
	 * @return Object
	 */
	public abstract <T extends Serializable> T getIdentifier();
	
	/**
	 * <p>Verifies if the entity is new.</p>
	 * @return Boolean
	 */
	public Boolean isNewEntity() {
		return ObjectUtility.isRef(this.getIdentifier());
	}
	
	@Override
	protected Entity clone() throws CloneNotSupportedException {
		return this;
	}

}
